package cn.baimo.mapper;

import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
public interface RegistrationMapper {
    //查询挂号单数量（累计服务人数）
    @Select("select count(1) from Registration")
    int selectRegistrationTotalNum();
    //通过医生查询挂号单数量（累计服务人数）
    @Select("select count(1) from Registration r LEFT JOIN doctor d on r.did=d.id LEFT JOIN hospital_division hd ON hd.id = d.hdid LEFT JOIN hospital h on h.id=hd.hid WHERE h.id=#{id}")
    int selectRegistrationTotalNumByHid(int id);
}
